﻿<%@ Page Language="VB" MasterPageFile="~/WebForm/MasterPage.master" AutoEventWireup="false" CodeFile="Main.aspx.vb" Inherits="WebForm_MainPage"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<script type="text/javascript">
//目前播放到第幾張
var nowIndex=0;
var num=1;
var _ie = true;
//判斷瀏覽器
 function mm_borwser(){
    var d=document; 
    num=1;
	if (window.XMLHttpRequest) { //Mozilla, Safari,...IE7	
		if(!window.ActiveXObject){// Mozilla, Safari,...
			_ie = false;
			document.getElementById("mmmm_showpic").innerHTML="<img src=\""+d.MM_p[nowIndex].src+"\" id=\"showimg\" style=\"-moz-opacity:0\"/>";
			mm_fadein();
		}
	}
 
	if(_ie){//IE6
		document.getElementById("mmmm_showpic").innerHTML="<img src=\""+d.MM_p[nowIndex].src+"\" id=\"showimg\" style=\"filter:alpha(opacity=0);\"/>";
		mm_fadein();	 
    }	
    nowIndex = (nowIndex+1)>= d.MM_p.length?0:nowIndex+1;
}

//圖片預載
function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images)
  { 
    if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0)
    { 
        d.MM_p[j]=new Image; 
        d.MM_p[j++].src=a[i];
    }
  }
}

//淡化效果
function mm_fadein(n){
    if(!_ie)
    {// Mozilla, Safari,...
		if(num !=20) 
		{
			num+=1;
			document.getElementById("showimg").style.MozOpacity=num/20;	
			setTimeout('mm_fadein()',0.01); //設定圖片變化速度
		}	 	
		else
		{
		    setTimeout('mm_borwser()',6000);
		}
	}
	else
	{//IE6
		if(num !=100) 
		{
			num+=3;
			document.getElementById("showimg").filters.alpha.opacity=num;	
			setTimeout('mm_fadein()',0.01); //設定圖片變化速度		
		}
		else
		{
		    setTimeout('mm_borwser()',6000);
		}
 	} 
}

document.body.onload = function() 
{ 
    if('<%=clsauth.GetUserID %>'!='angus')
    {
        //先停掉
        MM_preloadImages('<%=ResolveUrl("~/images/MATRIX_654x261_2.jpg")%>','<%=ResolveUrl("~/images/Shu_654x261.jpg")%>','<%=ResolveUrl("~/images/Vichy_654x261.jpg")%>','<%=ResolveUrl("~/images/loreal.jpg")%>','<%=ResolveUrl("~/images/lancome.jpg")%>');mm_borwser(); 
    }
}
</script>
<%--<div align="center">
<img src="<%=ResolveUrl("~/images/index_bg.jpg")%>" width="789" height="376">
</div>--%>
    
    <table width="100%" background="<%=ResolveUrl("~/images/BG.gif")%>" height="450" align="Center" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center">
            
            <div id="my_div"></div>
            <div id="mmmm_showpic"></div>
            </td>
        </tr>
    </table>

</asp:Content>


